<if condition="check_auth('addVideoContent')">
    <!-- Modal -->
    <div id="frm-post-popup" class="white-popup mfp-hide" style="border-radius: 5px;">
<style> 
	
	.ykupload{margin:0 auto;width:435px;}
	.containeryouku .pd30{padding-left:65px}
	.containeryouku .form-control{border-radius: 5px;}
	.uploadfile{width:150px;height: 14px;vertical-align: top;} 
</style>
<script type="text/javascript" src="__THEME_PUBLIC__/js/uploadyouku.js"></script>
<script>
	var USE_STREAM_UPLOAD = true;
	jQuery(document).ready(function(){ 
		var param = {client_id:"18532878da4e3089",access_token:"",oauth_opentype:"currentWindow",oauth_redirect_uri: + "{:U('video/index/index')}",oauth_state:"",completeCallback:"uploadComplete"};
		var reg = new RegExp("(^|\\#|&)access_token=([^&]*)(\\s|&|$)", "i");  
		if (reg.test(location.href)){
			var access_token = unescape(RegExp.$2.replace(/\+/g, " ")); 
			param.access_token = access_token;
		}
		youkuUploadInit(param);
	});
	function uploadComplete(data){
		//alert("videoid="+data.videoid+";title="+data.title);
		$('#url').attr("value","http://player.youku.com/player.php/sid/"+data.videoid+"/v.swf");
		//$("#upload-status-wraper").html("<h1>视频文件上传成功</h1><p>恭喜您，视频上传成功!<br />上传审核通过请留意侧边栏的站内信息<br />我们的工作人员将在第一时间给你回复，期间您如有问题可以咨询我们的客服人员，谢谢！</p>");
	}
				
	function categoryLoaded(data){
		if(data.categories) {
		var tpl = '';
			for (var i=0; i<data.categories.length; i++) {
				if(data.categories[i].term == 'Autos'){
					tpl += '<option value="' + data.categories[i].term + '" selected>' + data.categories[i].label + '</option>'; 
				}else{
					tpl += '<option value="' + data.categories[i].term + '" >' + data.categories[i].label + '</option>'; 
				}
			}
		$("#category-node").html(tpl);
		}
	}
</script>
<div id="youku-upload">
	<div class="containeryouku">
		<form class="well" name="video-upload">
				<div class="form-group">
					<label for="spanSWFUploadButton">选择文件：</label>
					<div id="uploadControl" >

					</div>
				</div>
				<div class="form-group">
					<label for="input01">视频标题：</label>
					<input type="text" class="form-control" id="input01" name="title">
				</div>
				<div class="form-group">
					<label for="textarea">视频简介：</label>
					<textarea class="form-control" id="textarea" rows="3" name="description"></textarea>
				</div>
				<div class="form-group">
					<label for="input02">视频标签：</label>
					<input type="text" class="form-control" id="input02" name="tags">
					<span class="help-inline"></span>
				</div>
				<div class="form-group">
					<label for="category-node">视频类别：</label>
					<select id="category-node" name="category" class="form-control"></select>
				</div>
				<div class="form-group">
					<label class="control-label">版权所有：</label>
						<label class="radio-inline">
							<input type="radio" name="copyright_type" id="copyright_type2" value="original" checked=""  style="margin-top:5px;margin-bottom: 0px;">原创
						</label>
						<label class="radio-inline">
							<input type="radio" name="copyright_type" id="copyright_type1" value="reproduced"  style="margin-top:4px;margin-bottom: 0px;">转载
						</label>

				</div>
				<div class="form-group">
					<label class="control-label">视频权限：</label>

						<label class="radio-inline" >
							<input type="radio" name="public_type" id="public_type1" value="all" checked="" style="margin-top:5px;margin-bottom: 0px;">公开
						</label>
						<label class="radio-inline">
							<input type="radio" name="public_type" id="public_type2" value="friend" style="margin-top:5px;margin-bottom: 0px;">仅好友
						</label>
						<label class="radio-inline">
							<input type="radio" name="public_type" id="public_type3" value="password" style="margin-top:5px;margin-bottom: 0px;">输入密码观看
						</label>
						<label class="radio-inline pd30" style="display:none" id="passwrod">
							<input type="text" class="input form-control" name="watch_password">
						</label>

				</div>
				<div class="form-actions">
					<button type="submit" class="btn btn-primary start" id="btn-upload-start" >
						<i class="icon-upload icon-white"></i>
						<span>开始上传</span>
					</button>
				</div>
		</form>
		<div class="row">
			<div class="span5 ykupload" id="upload-status-wraper"></div>
		</div>
		<br>
		<div class="well" id="shuoming">
			<h3 style="font-size: 15px;font-weight: bold;">说明</h3>
			<ul>
				<li>最大支持上传<strong>1 GB</strong> 视频文件</li>
				<li style="word-wrap: break-word;">允许上传的视频格式为：wmv,avi,dat,asf,rm,rmvb,ram,mpg,mpeg,3gp,mov,mp4,m4v,dvix,dv,dat,mkv,flv,vob,ram,qt,divx,cpk,fli,flc,mod。不符合格式的视频将会被丢弃，请确保视频格式的正确性，避免上传失败</li>
			</ul>
		</div>
	</div>
	<div id="complete"></div>
	<div id="login" style="width:100%;height:100%;position:fixed;z-index:999;left:0px;top:0px;overflow:hidden;display:none;"></div>
</div>

    </div>
    
</if>
